package com.technology.education.ui.common.board_video

import androidx.lifecycle.MutableLiveData
import com.technology.education.ext.toast
import com.technology.education.network.apiService
import me.hgj.jetpackmvvm.base.viewmodel.BaseViewModel
import me.hgj.jetpackmvvm.callback.databind.BooleanObservableField
import me.hgj.jetpackmvvm.callback.databind.IntObservableField
import me.hgj.jetpackmvvm.ext.request

/**
 *@author:create by BZY
 *Date: 2022/3/24 09
 */
@Deprecated("客服不需要白板")
class BoardVideoViewModel : BaseViewModel() {
    var roomId = ""
    var orderId = ""
    val showWait=BooleanObservableField(false)

    /**
     * 当前白板工具类型
     */
    val toolType = IntObservableField(0)

    /**
     * 当前画笔颜色
     */
    val colorType = IntObservableField(0)

    /**
     * 摄像头开启状态,默认开启
     */
    val cameraOpen = BooleanObservableField(true)

    /**
     * 前后摄像头
     */
    var fontCamera = true

    val result = MutableLiveData<Boolean>()

    /**
     * 结束辅导
     */
    fun finish() {
        request({ apiService.endOrder(hashMapOf("id" to orderId)) }, success = {
            result.postValue(true)
        }, error = {
            toast(it.errorMsg)
        }, isShowDialog = true)
    }
}